#include <iostream>
#include "HttpServer.hpp"
#include <memory>


void Usage(){
    std::cout<<"运行格式:\n\t"<<"./httpserver port[输入想使用的端口]"<<std::endl;
}

int main(int argc,char* argv[]){
    if(argc != 2){
        Usage();
        exit(4);
    }   

    std::shared_ptr<HttpServer> httpserver(new HttpServer(atoi(argv[1])));
    httpserver->InitHttpServer();
    httpserver->Loop();
    httpserver->~HttpServer();

    return 0;
}
